GtkWidget: Set style context direction.
authorCarlos Garnacho <carlosg@gnome.org>
Mon, 2 Aug 2010 15:24:27 +0000 (17:24 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Sat, 4 Dec 2010 14:37:27 +0000 (15:37 +0100)
gtk/gtkwidget.c

index 8321dc9e0580ac93f12376719629408ca0e196b4..af4497b8875550a88e25fc060e15d779dff89035 100644 (file)
@@ -9578,7 +9578,17 @@ gtk_widget_set_direction (GtkWidget        *widget,
   widget->priv->direction = dir;
 
   if (old_dir != gtk_widget_get_direction (widget))
-    gtk_widget_emit_direction_changed (widget, old_dir);
+    {
+      GtkStyleContext *context;
+
+      context = g_object_get_qdata (G_OBJECT (widget), quark_style_context);
+
+      if (context)
+        gtk_style_context_set_direction (context,
+                                         gtk_widget_get_direction (widget));
+
+      gtk_widget_emit_direction_changed (widget, old_dir);
+    }
 }
 
 /**
@@ -13270,7 +13280,11 @@ gtk_widget_get_style_context (GtkWidget *widget)
       GtkCssProvider *default_provider;
       GtkWidgetPath *path;
 
-      context = g_object_new (GTK_TYPE_STYLE_CONTEXT, NULL);
+      context = g_object_new (GTK_TYPE_STYLE_CONTEXT,
+                              "direction", gtk_widget_get_direction (widget),
+                              NULL);
+
+
       g_object_set_qdata_full (G_OBJECT (widget),
                                quark_style_context, context,
                                (GDestroyNotify) g_object_unref);